package com.wicket.okroperation.web.contorller;

import cn.hutool.core.bean.BeanUtil;
import com.github.pagehelper.Page;
import com.github.pagehelper.page.PageMethod;
import com.wicket.okroperation.biz.service.OperationsDeploymentService;
import com.wicket.okroperation.biz.service.dto.req.*;
import com.wicket.okroperation.biz.service.dto.res.*;
import com.wicket.okroperation.common.ro.OkrResult;
import com.wicket.okroperation.common.util.CommonFunctionHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author ：
 * @date ：
 *
 *
 * @version 1.0
 */
@RestController
@RequestMapping("/operation/operationsDeployment/")
public class OperationsDeploymentController {

    @Autowired
    OperationsDeploymentService operationsDeploymentService;

    /**
     * D6新增ngnix服务运行脚本
     */
    @PostMapping("addNgnixExecutionScript")
    public OkrResult<AddNgnixExecutionScriptRespDto> addNgnixExecutionScript(@RequestBody @Validated AddNgnixExecutionScriptReqDto reqDTO) {
        return OkrResult.success(operationsDeploymentService.addNgnixExecutionScript(reqDTO));
    }

    /**
     * D6新增集群es服务运行脚本
     */
    @PostMapping("addClusterEsExecutionScript")
    public OkrResult<AddClusterEsExecutionScriptRespDto> addClusterEsExecutionScript(@RequestBody @Validated AddClusterEsExecutionScriptReqDto reqDTO) {
        return OkrResult.success(operationsDeploymentService.addClusterEsExecutionScript(reqDTO));
    }

    /**
     * D6新增单实例es服务运行脚本
     */
    @PostMapping("addEsExecutionScript")
    public OkrResult<AddEsExecutionScriptRespDto> addEsExecutionScript(@RequestBody @Validated AddEsExecutionScriptReqDto reqDTO) {
        return OkrResult.success(operationsDeploymentService.addEsExecutionScript(reqDTO));
    }

    /**
     * D6新增集群nacos服务运行脚本
     */
    @PostMapping("addClusterNacosExecutionScript")
    public OkrResult<AddClusterNacosExecutionScriptRespDto> addClusterNacosExecutionScript(@RequestBody @Validated AddClusterNacosExecutionScriptReqDto reqDTO) {
        return OkrResult.success(operationsDeploymentService.addClusterNacosExecutionScript(reqDTO));
    }

    /**
     * D6新增apollo服务运行脚本
     */
    @PostMapping("addApolloExecutionScript")
    public OkrResult<AddApolloExecutionScriptRespDto> addApolloExecutionScript(@RequestBody @Validated AddApolloExecutionScriptReqDto reqDTO) {
        return OkrResult.success(operationsDeploymentService.addApolloExecutionScript(reqDTO));
    }

    /**
     * D6新增skywalking服务运行脚本
     */
    @PostMapping("addSkywalkingExecutionScript")
    public OkrResult<AddSkywalkingExecutionScriptRespDto> addSkywalkingExecutionScript(@RequestBody @Validated AddSkywalkingExecutionScriptReqDto reqDTO) {
        return OkrResult.success(operationsDeploymentService.addSkywalkingExecutionScript(reqDTO));
    }

    /**
     * D6执行动态寻表数据(公共)
     */
    @PostMapping("implementDynamicLookupDataCom")
    public OkrResult<ImplementDynamicLookupDataComRespDto> implementDynamicLookupDataCom
    (@RequestBody @Validated ImplementDynamicLookupDataComReqDto reqDTO){
        return OkrResult.success(operationsDeploymentService.implementDynamicLookupDataCom(reqDTO));
    }
/**
   * D6执行动态寻表删除数据(公共)
   */
    @PostMapping("implementDynamicLookupDeleteDataCom")
    public OkrResult<ImplementDynamicLookupDeleteDataComRespDto> implementDynamicLookupDeleteDataCom(@RequestBody @Validated ImplementDynamicLookupDeleteDataComReqDto reqDTO){
    return OkrResult.success(operationsDeploymentService.implementDynamicLookupDeleteDataCom(reqDTO));
    }
/**
   * D6执行私有化分离数据(公共)
   */
    @PostMapping("implementPrivatizationAndSeparationDataCom")
    public OkrResult<ImplementPrivatizationAndSeparationDataComRespDto> implementPrivatizationAndSeparationDataCom(@RequestBody @Validated ImplementPrivatizationAndSeparationDataComReqDto reqDTO){
    return OkrResult.success(operationsDeploymentService.implementPrivatizationAndSeparationDataCom(reqDTO));
    }
/**
   * D6执行清洗垃圾评价数据(公共)
   */
    @PostMapping("implementCleaningWasteEvaluationDataCom")
    public OkrResult<ImplementCleaningWasteEvaluationDataComRespDto> implementCleaningWasteEvaluationDataCom(@RequestBody @Validated ImplementCleaningWasteEvaluationDataComReqDto reqDTO){
    return OkrResult.success(operationsDeploymentService.implementCleaningWasteEvaluationDataCom(reqDTO));
    }
}
